import requests

from common.log_util import init_logger
from config import BASE_URL

logger = init_logger()


class LoginApi(object):

    @classmethod
    def login(cls, body):
        url = f"{BASE_URL}/api/sys/login"
        headers = {"Content-Type": "application/json"}
        logger.debug(f"url:{url}")
        logger.debug(f"headers:{headers}")
        resp = requests.post(url=url, headers=headers, json=body)
        logger.debug(f"resp:{resp.json()}")
        return resp
